package com.briup.ch08;

/**
 * @Author briup-adam
 * @Date 2023/10/17 下午5:14
 * @Description
 **/

public interface Action<T> {
    //这个方法不是泛型方法
    void  show(T t);
    T  get();

}
class  ActionImpl<C> implements  Action<C>{

    @Override
    public void show(C c) {
        System.out.println(c);
    }

    @Override
    public C get() {
        return null;
    }
}
class  ActionTest{
//    泛型方法
   static  <A> A methodA(A a){
       System.out.println(a.getClass());
       return a;
    }

    public static void main(String[] args) {
        ActionImpl<String> action = new ActionImpl<>();
        action.show("ok");
       Action<Integer> ac= new Action<Integer>(){

           @Override
           public void show(Integer integer) {
               System.out.println(integer);
           }

           @Override
           public Integer get() {
               return null;
           }
       };
       ac.show(120);
      String a= methodA("123");
    }


}